//
//  LinearModule.m
//  TengineTwo
//
//  Created by StandardUser on 10/02/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
//  updates the position linearly from velocity
//

#import "BulletModule.h"
#import "CGPointExtension.h"

@implementation BulletModule

-(void)update:(EntityModel *)e FromT:(float)t
{
    CGPoint position = ccp(0,0);
    CGPoint velocity = ccpForAngle(e.rotation);
    
    position.x = ((t - e.tOffset) * velocity.x);
    position.y = ((t - e.tOffset) * velocity.y);
    
    e.position = ccpAdd(e.origin, ccpMult(position, e.speed));
}

@end
